package cn.itsource.ymcc.service.impl;

import cn.itsource.ymcc.domain.Hei;
import cn.itsource.ymcc.domain.MessageSms;
import cn.itsource.ymcc.mapper.HeiMapper;
import cn.itsource.ymcc.mapper.MessageSmsMapper;
import cn.itsource.ymcc.service.IMessageSmsService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author whale.chen
 * @since 2022-07-16
 */
@Service
public class MessageSmsServiceImpl extends ServiceImpl<MessageSmsMapper, MessageSms> implements IMessageSmsService {
    @Autowired
    private MessageSmsMapper messageSmsMapper;
    @Autowired
    private HeiMapper heiMapper;
    @Override
    public void gohei(Long id) {
        //先从 这个表删除 ， 在把数据传给黑表
        MessageSms message=messageSmsMapper.selectById(id);
        Hei hei = new Hei();
        hei.setIp(message.getIp());
        heiMapper.insert(hei);
        messageSmsMapper.delete(id);
    }
}
